cmake_minimum_required(VERSION 3.10)

# 项目信息
project(serial_port_example)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 添加编译选项
add_compile_options(-Wall -Wextra -Werror)

# 查找源文件
file(GLOB SOURCES
    "*.cpp"
)

# 添加可执行文件
add_executable(serial_port_example ${SOURCES})

# 包含头文件目录
target_include_directories(serial_port_example PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# 设置可执行文件属性
set_target_properties(serial_port_example PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin
)
